﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Cryptography;

namespace SCP_UNA_MVC.Libs
{
    public static class PasswordHasher
    {
        private static SHA256Managed hasher = new   SHA256Managed();
        public static string Hash(string password)
        {
            byte[] passwordBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(password);
            byte[] passwordHash = hasher.ComputeHash(passwordBytes);
            return Convert.ToBase64String(passwordHash, 0, passwordHash.Length);
        }
    }
}